name: Deploy to GitHub Pages

on:
  push:
    branches: [master]

  workflow_dispatch:

jobs:
  deploy:
    name: Deploy to GitHub Pages
    runs-on: ubuntu-latest
    steps:
      - name: Check out repo
        uses: actions/checkout@v2
      - uses: actions/setup-node@v2
        with:
          node-version: 18.18.2
          cache: yarn
      - name: Build website
        run: |
          yarn install --frozen-lockfile
          yarn build
      - name: Deploy to GitHub Pages
        uses: peaceiris/actions-gh-pages@v3
        with:
          deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
          publish_dir: ./build
          external_repository: local-deploy/local-deploy.github.io
          publish_branch: master
          user_name: github-actions
          user_email: dl@varme.pw
